package net.lovesrc.allin.biz.treex;

import net.lovesrc.allin.Message;
import net.lovesrc.allin.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/treex")
public class TreexController extends BaseController {

    @Autowired
    private TreexService treexService;

    @Autowired
    private TreexRegisterService treexRegisterService;

    @GetMapping("/new-register")
    public Message newRegister(String inviteCode) {
        String newMobile = treexRegisterService.newRegister(inviteCode);
        return Message.success(newMobile);
    }

    @GetMapping("/auth-id")
    public Message authId(String mobile) {
        treexRegisterService.authId(mobile);
        return Message.success();
    }

    @GetMapping("/once")
    public Message once() {
        treexRegisterService.once();
        return Message.success();
    }

}